<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>123</title>
		<style>
			body {
				background-color: #ffffff;
			}

			.img {
				width: 300px;
				height: 300px;
				border: black 1px solid;
				background-color: darkgrey;
				object-fit: cover;
				object-position: 50% 20%;
			}

			/* 图片自适应的样式 */
			.img-object {
				object-fit: cover;
				object-position: 50% 20%;
			}
		</style>
	</head>
	<body>
		<blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
			预览图：<button id="remove-img">删除图片</button>
			<div class="layui-upload-list" id="view_upload_img">
				<img src="http://rkd1xovip.bkt.clouddn.com/FmwdZFnYhXx4-oRkC17_z1PMeKLf" class="img" value="33">
				<img src="http://rkd1xovip.bkt.clouddn.com/FqINdb9Mu3PvMqRwKFBmWYYWjzN1" class="img" value="34">
				<img src="http://rkd1xovip.bkt.clouddn.com/FpRvwtA3EP8Nmmocwnsm8QXu79al" class="img" value="35">
				<img src="http://rkd1xovip.bkt.clouddn.com/FsffCrGEF8l3YKHQsobcjZd2s9VE" class="img" value="36">
			</div>
		</blockquote>

		<!-- <img src="/static/images/蜡笔01.jpeg" onClick="remimg()">
		<button>删除图片元素</button> -->

		<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
		<script>
			layui.use(['form'], function() {
				var form = layui.form,
					layer = layui.layer,
					$ = layui.$,
					upload = layui.upload,
					element = layui.element;
				// $(document).ready(function() {
				// 	$("button").click(function() {
				// 		$("img").remove();
				// 	});
				// });

				$(document).ready(function() {
					$("#remove-img").click(function() {
						$("img").each(function(i, e) {
							$(this).remove()
						});
					});
				});


				// $("#blockquote div img").each(function(i, e) {
				// 	$(this).attr('id', 'remove_' + i)
				// })

				// obj.preview(function(index, file, result) {
				// 	$(".layui-upload-list").append('<img src="' + result + '" id="remove_' + index +
				// 		'" title="双击删除该图片" style="width:200px;height:auto;">')

				// 	//console.log(1, index); //得到文件索引
				// 	//console.log(2, file.name); //得到文件对象
				// 	//console.log(3, result); //得到文件base64编码，比如图片


				// })
				// $('#remove_' + index).bind('dblclick', function() { //双击删除指定预上传图片
				// 	delete files[index]; //删除指定图片
				// 	$(this).remove();
				// })


			});
		</script>
	</body>
</html>
